package com.shunwang.caipiao.data.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.shunwang.caipiao.data.dao.CaiPiaoDao;
import com.shunwang.caipiao.data.pojo.DoubleColor;

public class CaiPiaoDaoImpl extends SqlMapClientDaoSupport implements CaiPiaoDao{

	public List<DoubleColor> getDoubleColorAll(){
		return this.getSqlMapClientTemplate().queryForList("fuli.getDoubleColorAll");
	}
	
	public void saveDoubleColor(DoubleColor doubleColor){
		this.getSqlMapClientTemplate().insert("fuli.saveDoubleColor",doubleColor);
	}
	
	public void deleteDoubleColor(Integer sno){
		this.getSqlMapClientTemplate().delete("fuli.delDoubleColor",sno);
	}
	
	public void clearDoubleColor(){
		this.getSqlMapClientTemplate().delete("fuli.clearDoubleColor");
	}
	
	public boolean checkSnoExists(Integer sno){
		return (Integer)this.getSqlMapClientTemplate().queryForObject("fuli.checkSnoExists",sno) > 0? true:false;
	}
	
	public DoubleColor getDoubleColor(Integer sno){
		return (DoubleColor)this.getSqlMapClientTemplate().queryForObject("fuli.getDoubleColorBySno",sno);
	}
}
